package com.ymatou.apigateway.service;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONObject;

import com.ymatou.apigateway.parameter.SendLogisticsResult;
import com.ymatou.apigateway.parameter.SendLogisticsReturn;
import com.ymatou.iapi.coupon.parameter.old.CheckCouponsData;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*订单发货Call
*FreeMaker Template自动生成代码
*/
public class V1sendlogisticsCall extends YmatouBaseCall{
	private static String opurl ="api/v1?method=ymatou.order.deliver";
	
	public V1sendlogisticsCall() {
		super(EnvSetup.getSystemUrl("apigateway"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public String getCode()
	{
		return getString("code");
	}
	
	public String getMessage()
	{
		return getString("message");
	}
	
	public String getResults()
	{
		String Code = null;
		try {
			Code = new JSONObject(getString("content")).getString("results");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}
	
	 public SendLogisticsResult getSendLogisticsResult()
	    {
		 SendLogisticsResult data = null;
	        try {
	            data = (SendLogisticsResult) FormatUtil.GSONToObject(getString("content"), SendLogisticsResult.class);

	        } catch (Exception e) {
	            e.printStackTrace();
	        }
	        return data;
	    }
	

}